<?

session_start();
require_once("admin/dbconnect.php");
require_once("admin/classes/customer.php");
require_once("admin/classes/check_customer_session.php");

if(isset($_SESSION['ep_customer_id']))

{

	header("location:myaccount.php");

}

if($_POST['Submit_x'] != ""){

	$custObj=new customer("");
		
		
		$custObj->name=$_POST['name'];
		$custObj->surname=$_POST['surname'];
		$custObj->age=$_POST['age'];
		$custObj->gender=$_POST['gender'];
		$custObj->community=$_POST['community'];
		$custObj->city=$_POST['city'];
		$custObj->tel=$_POST['tel'];
		$custObj->mob=$_POST['mob'];
		$custObj->address=$_POST['address'];
		$custObj->other_city=$_POST['othernative'];
		$custObj->email=$_POST['email'];
		$custObj->password=$_POST['password1'];
				if($_POST['Date_of_Birth']){	
				$today = time(); #today's date in seconds since January 1, 1970
				$date = $_POST['Date_of_Birth'];
				$d = split("-",$date);
				$date_seconds = mktime(0,0,0,$d[0],$d[1],$d[2]); #turn $date into seconds since January 1, 1970		
				if ($today > $date_seconds) {
				$custObj->b_date=$d[2]."-".$d[0]."-".$d[1];
				}
				else {
				$mesg = "Entered birthdate can not be greater than todays date";
				}
				} else {
				$custObj->b_date=$_POST['Date_of_Birth'];
				}
		$custObj->marital_status=$_POST['marital_status'];

		$custObj->expectation=$_POST['expectation'];
				
				if(!$mesg){
				$mesg = $custObj->q_add_customer();
					}
				
				if(!$mesg){
				header("location:login.php?submit=submit&username=".$_POST['email']."&password=".$_POST['password1']);
				//header("location: profile.php?cid=".$_SESSION['ep_customer_id']);
				}
				
		
		
}
?>
<?php require_once('include/header.php'); ?>

      <div id="middle_container_for_homepage">
    <div id="homepage_top_image"><img src="images/images/homepage_top_corner_820x5.jpg"  height="5" /></div> 
      
    <div id="middle_register" style="padding-top:0px;">
    <div id="reg_page_middle_data" style="padding-top:5px;">
    	<div id="page_heading" style="width:796px; margin-bottom:10px;">Register to eParinay.com. Its totally FREE !!!</div>
    	<div id="reg_left_middle_right">
		<?=$mesg?>
			<div id="padding_use_only" style="">
    	  <div id="registration_form_container">
            <form action="register.php" method="post" name="quickreg" target="_self" id="quickreg">
            	<div id="registration_row2" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column">
                	  <div id="text_before_colon">First &amp; Last Name </div><div id="colon">:</div></div>
                  <div id="fields_column"><input type="text" name="name" style="width:168px; letter-spacing:1px; float:left; margin-right:5px;" />
                  <input type="text" name="surname" style="width:168px; letter-spacing:1px; float:left;" />
                  </div>
                </div>
                <!--<div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Last Name</div><div id="colon">:</div></div>
                  <div id="fields_column"><input type="text" name="reg_last_name" style="width:200px; letter-spacing:1px;" /></div>
                </div>-->
                <div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Gender</div><div id="colon">:</div></div>
                  <div id="fields_column">
                  	<select name="gender" style="width:65px;">
                        <option value="Female" selected="selected">Female</option>
                        <option value="Male">Male</option>
                    </select>
                  	&nbsp;&nbsp;&nbsp;&nbsp;Age :&nbsp;
                    <select name="age" id="age" style="width:65px;">
           	    <optgroup label="Select"></optgroup>
                        	<option value="18">18</option>
                            <option value="19">19</option>
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                            <option value="24">23</option>
                            <option value="25">25</option>
                            <option value="26">26</option>
                            <option value="27">27</option>
                            <option value="28">28</option>
                            <option value="29">29</option>
                            <option value="30">30</option>
                            <option value="31">31</option>
                            <option value="32">32</option>
                            <option value="33">33</option>
                            <option value="34">34</option>
                            <option value="35">35</option>
                            <option value="36">36</option>
                            <option value="37">37</option>
                            <option value="38">38</option>
                            <option value="39">39</option>
                            <option value="40">40</option>
                        </select>
                  </div>
                </div>
                <!--<div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Age</div><div id="colon">:</div></div>
              <div id="fields_column">
                    	<select style="width:65px;" name="reg_age">
                        	<optgroup label="Select"></optgroup>
                        	<option id="18" value="18">18</option>
                            <option id="18" value="19">19</option>
                        </select>
                  </div>
                </div>-->
                <div id="registration_row2" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Date of Birth</div><div id="colon">:</div></div>
                  <div id="fields_column">
                    <div id="dob_input"><input type="text" name="Date_of_Birth" id="dob" readonly="readonly" style="width:120px;"  />
                    
                                        </div>
                  <div id="bob_icon"><img src="images/images/calendar_view_day.png" width="16" height="16" border="0" name="cal_img" style="cursor:pointer;" onclick="displayCalendar(document.quickreg.dob,'mm-dd-yyyy',this);"  /></div><div id="date_format">(MM/DD/YYYY)</div>
                  <div id="hidden"><input type="text" name="hide_day" style="width:13px; padding:0px;" /></div>
                    <div id="hidden"><input type="text" name="hide_month" style="width:13px; padding:0px;" /></div>
                    <div id="hidden" style="width:33px;"><input type="text" name="hide_year" style="width:28px; padding:0px;" /></div>
                  </div>
                </div>
                <div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Telephone</div><div id="colon">:</div></div>
                  <div id="fields_column"><input type="text" name="tel" style="width:120px; letter-spacing:1px;" />
                  &nbsp;&nbsp;Mobile&nbsp;: &nbsp;
                  <input name="mob" type="text" id="mob" style="width:140px; letter-spacing:1px;" />
                  </div>
                </div>
                <div id="registration_row2" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Address</div><div id="colon">:</div></div>
                  <div id="fields_column"><textarea name="address" style="width:346px; height:40px; padding:3px; letter-spacing:1px;"></textarea>
                  </div>
                </div>
                <div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">

                	<div id="text_column"><div id="text_before_colon">City</div><div id="colon">:</div></div>
                  <div id="fields_column">
                  	<div id="reg_city"><select name="city" id="city" style="width:120px;" />
<?
                            $str="select * from nativeplace order by nativeplace_id DESC";
                            $rc = mysql_query($str) or die ("Sorry! could not execute query $str ".mysql_error());
                            while($row=mysql_fetch_array($rc)){
                        ?>
                            <option value="<?=$row['nativeplace_id']?>" <?if($_REQUEST['community']==$row['community_id']){ echo "selected";}?>><?=$row['nativeplace']?></option>
                        <? } ?>
              		</select></div>
                    <div id="other_city">Other City<span class="red-txt">*</span>&nbsp;:&nbsp;<input name="othernative" type="text" id="othernative" style="width:135px; letter-spacing:1px;" value="<?=$_REQUEST['othernative']?>" /></div>
                  </div>
                </div>
                <div id="registration_row2" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Login Email</div><div id="colon">:</div></div>
                  	<div id="fields_column"><input name="email" type="text" value="<?=$_REQUEST['email']?>" style="width:344px; color:#0033FF; letter-spacing:1px;" />
               	  </div>
                </div>
                <div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Login Password</div><div id="colon">:</div></div>
                  	<div id="fields_column"><input name="password1" type="password" id="password1" style="width:120px;" />
               	  &nbsp; Retype : 
               	    <input name="password2" type="password" id="password2" style="width:120px;" onchange="thesame(document.QuickReg.password2.value, document.QuickReg.password1.value)" />
               	  </div>
                </div>
                <!--<div id="registration_row2" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
					<div id="text_column"><div id="text_before_colon">Security Question</div><div id="colon">:</div></div>
                    <div id="fields_column">
						<select name="sec_que" style="width:212px;">
							<option selected="selected"></option>
							<option id="q1" value="q1">What is your favorite book name?</option>
							<option id="q2" value="q2">Location you like the most?</option>
							<option id="q3" value="q3">q3</option>
							<option id="q4" value="q4">q4</option>
							<option id="q5" value="q5">q5</option>
                    	</select>
                    </div>
                </div>-->
                <!--<div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
					<div id="text_column"><div id="text_before_colon">Your Answer</div><div id="colon">:</div></div>
                    <div id="fields_column"><input name="sec_ans" type="text" id="sec_ans" style="width:200px;" /></div>
                </div>-->
                <div id="registration_row2" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Marital Status</div><div id="colon">:</div></div>
                  <div id="fields_column">
                  	<input name="marital_status" type="radio" id="marital_status" style="border:none; background-color:#EDF9FE;" onclick="disbNoChildren(this.value)" value="unmarried" checked="checked", />Unmarried
                    <input type="radio" name="marital_status" value="widow" style="border:none; background-color:#EDF9FE;" id="marital_status1" onclick="disbNoChildren(this.value)" />Widow/Widower
                    <input type="radio" name="marital_status" value="divorcee" style="border:none; background-color:#EDF9FE;" id="marital_status2" onclick="disbNoChildren(this.value)" />Divorcee<br />
                    <input type="radio" name="marital_status" value="separated" style="border:none; background-color:#EDF9FE;" onclick="disbNoChildren(this.value)" />Separated</div>
                </div>
                <div id="registration_row1" onmouseover="myBG(this,'#F3FFD7')" onmouseout="myBG(this,'')">
                	<div id="text_column"><div id="text_before_colon">Preferred Partner</div><div id="colon">:</div></div>
                  <div id="fields_column"><textarea name="expectation" id="expectation" style="width:352px; height:40px; padding:3px; letter-spacing:1px;"></textarea>
                  </div>
                </div>
                <div id="registration_row2">
                	<div id="text_column">&nbsp;</div><input name="community" type="hidden" id="community" value="1" />
                    <div id="fields_column">

               	      <label>
                  	      <input name="Submit" type="image" id="Submit" style="width:75px; height:25px; border:none; background-color:#EDF9FE; padding-left:0px;" onClick="return chkqck();" src="images/images/search_go.jpg" width="55" height="21" border="0" alt="Register to eParinay.com" title="Register to eParinay.com" />
               	      </label>
                    </div>
                </div>
				<div id="lal" style="height:2px; clear:both;">&nbsp;</div>
              </form>
                <div id="register_gen_info">
                    <p>Free registration with eParinay.com in just a minute!<br />
                    All fields need to be filled. <span class="red-txt">*</span>Other city is optional.<br />
                    Note: Please do not mention your contact number other than Telephone and Mobile fields.<br />
                    Register with eParinay.com now and express interest in [count] members, FREE !</p>
                </div>
            </div>
			</div>
        	


            <div id="reg_right_col">
           	  <div id="right_ad">
			  <?
// ad code goes here
$sqlad = "select * from site_ads where id = 3 order by id ASC";
$rsad = mysql_query($sqlad) or die(mysql_error());
$rowad=mysql_fetch_array($rsad)	
?>
			  <? if($rowad['image_name']){?>
	<a target="_blank" href="openUrl.php?url=<?=$rowad['url_for_image']?>" border="0">
			  <img src="uploaded/ads/<?=$rowad['image_name'] ?>" width="200" height="450" border="0" />
			  </a><?} ?>
			  </div>
          </div>
    	</div>
        <div id="google_ads_750px"><!--Google adds will be here width 750px--></div>
        </div>
      <div id="buddhist_portal">
      	<div id="focus_text"><img src="images/images/home_page_text.jpg" alt="home page text" width="489" height="48" longdesc="http://www.eparinay.com" /></div>
  	<div id="register_button"><a href="register.php"><img src="images/images/homepage_register_button.jpg" alt="Register to eParinay. Its free now 1" longdesc="http://www.eparinay.com/register.php" title="Register to eParinay. Its free now!" border="0" width="220" height="40" /></a></div>
  </div>
  <div id="link_home"><span class="red-txt">&bull;&nbsp;&nbsp;</span>Search by Community: <A title="Marathi Matrimonial" 
                                href="buddhist-matrimony-community-search.php?comm=1">Marathi</A>, <A title="Hindi Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=9">Hindi</A>, <A title="Gujarati Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=2">Gujarati</A>, <A title="Punjabi Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=3">Punjabi</A>, <A title="Sindhi Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=4">Sindhi</A>, <A title="Marwari Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=5">Marwari</A>, <A title="Tamil Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=6">Tamil</A>, <A title="Assamese Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=7">Assamese</A>, <A title="Kannada Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=8">Kannada</A>, <A title="Malayalam Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=10">Malayalam</A>, <A title="Bengali Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=11">Bengali</A>, <A title="Oriya Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=12">Oriya</A>, <A title="Telugu Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=13">Telugu</A>, <A title="Kerala Matrimonial"
                                href="buddhist-matrimony-community-search.php?comm=14">Kerala</A> <br />
    <span class="red-txt">&bull;&nbsp;&nbsp;</span>Search by Region: <A title="India Matrimonial" 
                                href="buddhist-parinay-region-search.php?con=1">India</A>, <A title="USA Matrimonial"
                                href="buddhist-parinay-region-search.php?con=2">USA</A>, <A title="UK Matrimonial"
                                href="buddhist-parinay-region-search.php?reli=3">UK</A>, <A title="UAE Matrimonial"
                                href="buddhist-parinay-region-search.php?con=4">UAE</A>, <A title="Canada Matrimonial"
                                href="buddhist-parinay-region-search.php?con=5">Canada</A>, <A title="Singapore Matrimonial"
                                href="buddhist-parinay-region-search.php?reli=6">Singapore</A>, <A title="Malaysia Matrimonial"
                                href="buddhist-parinay-region-search.php?con=8">Malaysia</A>, <A title="Thailand Matrimonial"
                                href="buddhist-parinay-region-search.php?con=14">Thailand</A>, <A title="New Zealand Matrimonial"
                                href="buddhist-parinay-region-search.php?con=9">New
      Zealand</A>, <A title="South Africa Matrimonial" 
                                href="buddhist-parinay-region-search.php?con=10">South
                                Africa</A>, <A title="Indonesia Matrimonial" 
                                href="buddhist-parinay-region-search.php?con=12">Indonesia</A>, <A title="Pakistan Matrimonial"
                                href="buddhist-parinay-region-search.php?con=7">Pakistan</A>, <A title="Saudi Arabia Matrimonial"
                                href="buddhist-parinay-region-search.php?con=13">Saudi
      Arabia</A>, <A title="Australia Matrimonial" 
                                href="buddhist-parinay-region-search.php?con=15">Australia</A><br />

 </div>
  </div>
  <div id="corner_container_bottom_for_homepage"><img src="images/images/homepage_bottom_corner_820x10.jpg"  height="10" /></div>
    </div> 
      <!-- middle_container ends -->
    
    
        
    
<?php require_once('include/footer.php'); ?>
